import 'package:boss/color_constant.dart';
import 'package:flutter/material.dart';
import 'dart:math';

class DefaultFailedImage extends StatelessWidget {
  final double width;
  final double height;

  const DefaultFailedImage({
    Key key,
    this.width,
    this.height,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      width: width,
      height: height,
      color: ColorConstant.fafa,
      alignment: Alignment.center,
      child: LayoutBuilder(
        builder: (context, constrints) {
          var size = min(constrints.maxWidth, constrints.maxHeight) * 0.6;

          return Image.asset(
            'assets/image/loading_field_icon.png',
            width: size,
            height: size,
          );
        },
      ),
    );
  }
}
